{template 'header', 'member'}
{if $action == 'grade'}
<div class="menu">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="tab_on"><a href="?action={$action}"><span>账户升级</span></a></td>
<td class="tab"><a href="grade.php"><span>服务列表</span></a></td>
</tr>
</table>
</div>
<form method="post" action="?" onsubmit="return check();">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="groupid" value="{$groupid}"/>
<table cellspacing="1" cellpadding="10" class="tb">
<tr>
<td class="tl">当前组</td>
<td class="tr">{$GROUP[$_groupid][groupname]}</td>
</tr>
<tr>
<td class="tl">升级为</td>
<td class="tr">{$GROUP[$groupid][groupname]}</td>
</tr>
{if $fee>0}
<tr>
<td class="tl">应付总额</td>
<td class="tr"><span class="f_price px16" id="money">{$fee}</span> {$DT[money_unit]}</td>
</tr>
<tr id="mymoney" style="display:none;">
<td class="tl">账户余额</td>
<td class="tr"><span class="f_blue">{$_money}</span> {$DT[money_unit]}</td>
</tr>
<tr id="payword" style="display:none;">
<td class="tl"><span class="f_red">*</span> 支付密码</td>
<td class="tr">{template 'password', 'chip'}&nbsp;<span id="dpassword" class="f_red"></span></td>
</tr>
<tr id="paytype" style="display:none;">
<td class="tl"><span class="f_red">*</span> 支付方式</td>
<td class="tr">
	<table cellspacing="5" cellpadding="5">
	{php $PAYLIST = get_paylist();}
	<input type="hidden" name="bank" id="bank" value="{$PAYLIST[0][bank]}"/>
	{loop $PAYLIST $k $v}
	<tr onclick="$('#bank').val($('#paytype :checked').val());">
	<td><input type="radio" name="bank" value="{$v[bank]}" id="bank-{$v[bank]}"{if $k==0} checked{/if}/></td>
	<td><label for="bank-{$v[bank]}" class="c_p"><img src="{DT_PATH}api/pay/{$v[bank]}/logo.gif" alt=""/></label></td>
	<td>{if $v[percent]>0}手续费 {$v[percent]}%{/if}</td>
	</tr>
	{/loop}
	</table>
</td>
</tr>
{else}
<tr>
<td class="tl">公司名称</td>
<td class="tr"><input type="text" name="company" id="company" value="{$_company}" size="50"/> <span id="dcompany" class="f_red"></span></td>
</tr>
{/if}
<tr>
<td class="tl"> </td>
<td class="tr">
<input type="submit" name="submit" value="申请升级" class="btn_g"/>&nbsp;&nbsp;
<input type="button" value="重新选择" class="btn" onclick="Go('grade.php');"/>
</td>
</tr>
</table>
</form>
{elseif $action == 'vip'}
<div class="menu">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="tab_on"><a href="?action={$action}"><span>{VIP}续费</span></a></td>
<td class="tab"><a href="?action=index"><span>账户详情</span></a></td>
</tr>
</table>
</div>
<form method="post" action="?" onsubmit="return check();">
<input type="hidden" name="action" value="{$action}"/>
<table cellspacing="1" cellpadding="10" class="tb">
<tr>
<td class="tl">到期时间</td>
<td class="tr">{$todate}</td>
</tr>
<tr>
<td class="tl">剩余时间</td>
<td class="tr">{$havedays} 天</td>
</tr>
<tr>
<td class="tl">服务费用</td>
<td class="tr"><span class="f_red">{$MG[fee]}</span> {$DT[money_unit]}/年</td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 续费年限</td>
<td class="tr">
<select name="year" id="year" onchange="$('#money').html(this.value*{$MG[fee]});">
<option value="1"<?php if($year == 1) echo ' selected';?>>1年</option>
<option value="2"<?php if($year == 2) echo ' selected';?>>2年</option>
<option value="3"<?php if($year == 3) echo ' selected';?>>3年</option>
</select>
</td>
</tr>
<tr>
<td class="tl">应付总额</td>
<td class="tr"><span class="f_price px16" id="money">{$fee}</span> {$DT[money_unit]}</td>
</tr>
<tr id="mymoney" style="display:none;">
<td class="tl">账户余额</td>
<td class="tr"><span class="f_blue">{$_money}</span> {$DT[money_unit]}</td>
</tr>
<tr id="payword" style="display:none;">
<td class="tl"><span class="f_red">*</span> 支付密码</td>
<td class="tr">{template 'password', 'chip'}&nbsp;<span id="dpassword" class="f_red"></span></td>
</tr>
<tr id="paytype" style="display:none;">
<td class="tl"><span class="f_red">*</span> 支付方式</td>
<td class="tr">
	<table cellspacing="5" cellpadding="5">
	{php $PAYLIST = get_paylist();}
	<input type="hidden" name="bank" id="bank" value="{$PAYLIST[0][bank]}"/>
	{loop $PAYLIST $k $v}
	<tr onclick="$('#bank').val($('#paytype :checked').val());">
	<td><input type="radio" name="bank" value="{$v[bank]}" id="bank-{$v[bank]}"{if $k==0} checked{/if}/></td>
	<td><label for="bank-{$v[bank]}" class="c_p"><img src="{DT_PATH}api/pay/{$v[bank]}/logo.gif" alt=""/></label></td>
	<td>{if $v[percent]>0}手续费 {$v[percent]}%{/if}</td>
	</tr>
	{/loop}
	</table>
</td>
</tr>
<tr>
<td class="tl"> </td>
<td class="tr" height="50"><input type="submit" name="submit" value="立即续费" class="btn_g"/></td>
</tr>
</table>
</form>
{else}
<div class="menu">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="tab_on"><a href="?action=index"><span>帐户详情</span></a></td>
<td class="tab"><a href="grade.php"><span>账户升级</span></a></td>
</tr>
</table>
</div>
<div class="t2">基本资料</div>
<table cellspacing="1" cellpadding="8" class="tb">
{if $user[truename]}
<tr>
<td class="tl">姓名</td>
<td class="tr">{$user[truename]} （{if $user[gender]==1}先生{else}女士{/if}）</td>
</tr>
{/if}
{if $MG[type]}
<tr>
<td class="tl">公司</td>
<td class="tr">
{if $MG[homepage]}
<a href="{$linkurl}" target="_blank" class="b">{$company}</a>
{else}
{$company}
{/if}
</td>
</tr>
{/if}
<tr>
<td class="tl">会员名</td>
<td class="tr">{$username}</td>
</tr>
<tr>
<td class="tl">昵称</td>
<td class="tr">{$passport}</td>
</tr>
<tr>
<td class="tl">会员组</td>
<td class="tr">{$MG[groupname]}</td>
</tr>
<tr>
<td class="tl">上次登录</td>
<td class="tr">{timetodate($logintime, 5)}{if $DT[login_log]==2}&nbsp;&nbsp;<a href="record.php?action=login" class="b">登录记录</a>{/if}</td>
</tr>
<tr>
<td class="tl">注册时间</td>
<td class="tr">{timetodate($regtime, 5)}</td>
</tr>
{if $support}
<tr>
<td class="tl">客服专员</td>
<td class="tr"><a href="ask.php?action=support" class="b">{$support}</a></td>
</tr>
{/if}
{if $vip}
{elseif $groupid>4}
<tr>
<td class="tl"></td>
<td class="tr"><input type="button" value="会员升级" class="btn_g" onclick="Go('grade.php');"/></td>
</tr>
{/if}
</table>
{if $vip}
<div class="t2">{VIP}信息</div>
<table cellspacing="1" cellpadding="8" class="tb">
<tr>
<td class="tl">{VIP}级别</td>
<td class="tr"><img src="{DT_SKIN}image/vip_{$vip}.gif" alt="{VIP}" title="{VIP}:{$vip}级"/></td>
</tr>
<tr>
<td class="tl">服务开始</td>
<td class="tr">{timetodate($fromtime, 3)}</td>
</tr>
<tr>
<td class="tl">服务结束</td>
<td class="tr">{timetodate($totime, 3)}</td>
</tr>
<tr>
<td class="tl">剩余时间</td>
<td class="tr"><strong>{$havedays}</strong> 天</td>
</tr>
<tr>
<td class="tl"></td>
<td class="tr"><input type="button" value="服务续费" class="btn_g" onclick="Go('?action=vip');"/></td>
</tr>
</table>
{/if}
<div class="t2">身份认证</div>
<table cellspacing="1" cellpadding="8" class="tb">
{if $MOD[vemail]}
<tr>
<td class="tl">邮件认证</td>
<td class="tr"><a href="validate.php?action=email">{if $vemail}<span class="f_green">已通过</span>{else}<span class="f_gray">未通过</span>{/if}</a></td>
</tr>
{/if}
{if $MOD[vmobile]}
<tr>
<td class="tl">手机认证</td>
<td class="tr"><a href="validate.php?action=mobile">{if $vmobile}<span class="f_green">已通过</span>{else}<span class="f_gray">未通过</span>{/if}</a></td>
</tr>
{/if}
{if $MOD[vbank]}
<tr>
<td class="tl">银行认证</td>
<td class="tr"><a href="validate.php?action=bank">{if $vbank}<span class="f_green">已通过</span>{else}<span class="f_gray">未通过</span>{/if}</a></td>
</tr>
{/if}
{if $MOD[vtruename]}
<tr>
<td class="tl">实名认证</td>
<td class="tr"><a href="validate.php?action=truename">{if $vtruename}<span class="f_green">已通过</span>{else}<span class="f_gray">未通过</span>{/if}</a></td>
</tr>
{/if}
{if $MOD[vcompany]}
<tr>
<td class="tl">公司认证</td>
<td class="tr"><a href="validate.php?action=company">{if $vcompany}<span class="f_green">已通过</span>{else}<span class="f_gray">未通过</span>{/if}</a></td>
</tr>
{/if}
</table>
{/if}
<script type="text/javascript">s('account');</script>
<script type="text/javascript">
{if $action == 'grade'}
{if $fee > 0}
var money = {$fee};
function check() {
	if(money > {$_money}) {
		Go('charge.php?action=pay&reason=grade|{$groupid}&amount='+money+'&bank='+$('#bank').val());
		return false;
	}
	if(money > {$DT[quick_pay]}){
		if(Dd('password').value.length < 6) {
			Dmsg('请填写支付密码', 'password');
			return false;
		}
	}
	return true;
}
window.setInterval(
	function() {
		if(money > {$_money} || {$_money} < 0.01) {
			$('#mymoney').hide();$('#paytype').show();$('#payword').hide();
		} else {
			$('#mymoney').show();$('#paytype').hide();if(money > {$DT[quick_pay]}){$('#payword').show();}
		}
	}, 
500);
{else}
function check() {
	if(Dd('company').value.length < 5) {
		Dmsg('请填写公司名称', 'company');
		return false;
	}
	return true;
}
{/if}
{elseif $action == 'vip'}
function check() {
	var money = $('#year').val()*{$MG[fee]};
	if(money > {$_money}) {
		Go('charge.php?action=pay&reason=vip|'+$('#year').val()+'&amount='+money+'&bank='+$('#bank').val());
		return false;
	}
	if(money > {$DT[quick_pay]}){
		if(Dd('password').value.length < 6) {
			Dmsg('请填写支付密码', 'password');
			return false;
		}
	}
	return true;
}
window.setInterval(
	function() {
		var money = $('#year').val()*{$MG[fee]};
		if(money > {$_money} || {$_money} < 0.01) {
			$('#mymoney').hide();$('#paytype').show();$('#payword').hide();
		} else {
			$('#mymoney').show();$('#paytype').hide();if(money > {$DT[quick_pay]}){$('#payword').show();}
		}
	}, 
500);
{/if}
</script>
{template 'footer', 'member'}